
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 2290. -- 【POJ Challenge】翻版玛丽 -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>2290: 【POJ Challenge】翻版玛丽</h2><span class=green>Time Limit: </span>5 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>1024 MB<br><span class=green>Submit: </span>3&nbsp;&nbsp;<span class=green>Solved: </span>0<br>[<a href='submitpage.php?id=2290'>Submit</a>][<a href='problemstatus.php?id=2290'>Status</a>][<a href='bbs.php?id=2290'>Discuss</a>]</center><h2>Description</h2><div class=content><p></p>
<p>
<dd>
<div>
<p>lqp18_31和1tthinking虽然是两个性格完全不同的人, 但是他们都喜欢玩 'Super Mario Bros'.</p>
<p>一天lqp18_31和1tthinking正玩得高兴，突然发现他们的Mac坏掉了。于是他们求助ftiasch，想借他的电脑。但是由于ftiasch使用的是Ubuntu，没有super mario bros这个游戏，ftiasch打算写一个mario给两个可怜的小朋友玩。</p>
<p>不过写着写着，ftiasch就觉得不好玩了，跑去找她的姐妹们玩了。你能不能帮助ftiasch写这个游戏？</p>
<p><img alt="" src="http://media.openjudge.cn/images/g3200_1.png" /></p>
</div>
<p></p>
</dd>
</p></div><h2>Input</h2><div class=content><p></p>
<p>
<dt>&nbsp; </dt>
<dd>
<div>
<p>第一行两个整数 <em>R</em> and <em>C</em>, 表示游戏地图的大小 (1 &le; <em>R</em>, <em>C</em> &le; 300)。</p>
<p>第二行两个整数 <em>x<sub>mario</sub></em> and <em>y<sub>mario</sub></em>, t表示small mario所在的坐标 (0 &le; <em>x<sub>mario</sub></em> &lt; <em>R</em>, 0 &le; <em>y<sub>mario</sub></em> &lt; <em>C</em>).</p>
<p>第三行两个整数 <em>x<sub>mush</sub></em> and <em>y<sub>mush</sub></em>, 表示唯一一个蘑菇的坐标 (如果 <em>x<sub>mush</sub></em> or <em>y<sub>mush</sub></em> 等于 -1, 表示不存在)。</p>
<p>第四行四个整数 <em>x<sub>tube1</sub></em>, <em>y<sub>tube1</sub></em>, <em>x<sub>tube2</sub></em>, <em>y<sub>tube2</sub></em>, 表示两个水管的坐标。 (if <em>x<sub>tube1</sub></em> or <em>y<sub>tube1</sub></em> or <em>x<sub>tube2</sub></em> or <em>y<sub>tube2</sub></em> 等于 -1, 表示不存在).</p>
<p>第五行一个整数 <em>n</em>, 表示block的数量，然后是 <em>n</em> 对整数， 表示block[i]的坐标。</p>
<p>第六行一个整数 <em>m</em>, 表示coin的数量，然后是 <em>m</em> 对整数， 表示coin[i]的坐标。</p>
<p>第七行一个字符串，表示动作序列。</p>
<p>下面给出所有物体的像素图形：</p>
<table>
    <tbody>
        <tr>
            <td>Small mario</td>
            <td>
            <pre style="font-family: monospace; white-space: pre"><br />     ********        <br />    ************     <br />    ####....#.       <br />  #..###.....##....  <br />  ###.......######   <br />     ...........     <br />    ##*#######       <br /> ####*******######   <br />...#***.****.*###....<br />....**********##.....<br />....****    *****....<br />  ####        ####   <br />######        ###### <br /></pre>
            </td>
        </tr>
        <tr>
            <td>Big mario</td>
            <td>
            <pre style="font-family: monospace; white-space: pre"><br />     ********        <br />    **************   <br />    ####....#.       <br />  #..##.....#.....   <br />  #..###.....##....  <br />  ###.......######   <br />     ...........     <br />    ##*######        <br />  ####*#####*#####   <br />######*******####### <br />...#***.****.*###....<br />....**********##.....<br />...**************....<br />    ****    ****     <br />  ####        ####   <br />######        ###### <br /></pre>
            </td>
        </tr>
        <tr>
            <td>Mushroom</td>
            <td>
            <pre style="font-family: monospace; white-space: pre"><br />   ########   <br /> ##.******.## <br />##...****...##<br />#............#	<br />#..########..#<br />###..#..#..###<br />  #..#..#..#  <br />  #........#  <br />   ########   <br /></pre>
            </td>
        </tr>
        <tr>
            <td>Tube</td>
            <td>
            <pre style="font-family: monospace; white-space: pre"><br />####################<br />#------------------#<br />#------------------#<br />####################<br />    #----------#    <br />    #----------#    <br />    #----------#    <br />    #----------#        <br />    ############    <br /></pre>
            </td>
        </tr>
        <tr>
            <td>Coin</td>
            <td>
            <pre style="font-family: monospace; white-space: pre"><br /> ### <br />#...#<br />#.#.#<br />#.#.#<br />#...#<br /> ### <br /></pre>
            </td>
        </tr>
        <tr>
            <td>Block</td>
            <td>
            <pre style="font-family: monospace; white-space: pre"><br />##############<br />#...#......#.#<br />##############<br />#..#....#....#<br />##############<br />#.....#......#<br />##############<br />#.#..#....#..#<br />##############<br /></pre>
            </td>
        </tr>
    </tbody>
</table>
<p>保证输入不会重叠，且mario一开始脚下一定有砖块。 重叠指有非空格重叠。</p>
<p>下面是重叠：</p>
<br />
<br />
<pre style="font-family: monospace; white-space: pre"><br />##############<br />#...#......#.#<br />##############<br />#..#....#....#<br />##############<br />#.....#......#<br />##############<br />#.#..#....#..#<br />##############**     <br />    ####....#.       <br />  #..###.....##....  <br />  ###.......######   <br />     ...........     <br />    ##*#######       <br /> ####*******######   <br />...#***.****.*###....<br />....**********##.....<br />....****    *****....<br />  ####        ####   <br />######        ###### <br /></pre>
<p>下面不是重叠：</p>
<pre style="font-family: monospace; white-space: pre"><br />                 ##############<br />                 #...#......#.#<br />                 ##############<br />                 #..#....#....#<br />                 ##############<br />                 #.....#......#<br />     ********    ##############    <br />    ************ #.#..#....#..#    <br />    ####....#.   ##############    <br />  #..###.....##....  <br />  ###.......######   <br />     ...........     <br />    ##*#######       <br /> ####*******######   <br />...#***.****.*###....<br />....**********##.....<br />....****    *****....<br />  ####        ####   <br />######        ###### <br /></pre>
<p>字符串包含 'D','L','R','P'.</p>
<p>R：如果向右不会导致mario和某个block、tube重叠，mario向右。</p>
<p>L：如果向左不会导致mario和某个block、tube重叠，mario向左。</p>
<p>D：如果mario脚下是某个tube，mario到达另一个tube的正上方。</p>
<p>Mario 在水管上方：</p>
<pre style="font-family: monospace; white-space: pre"><br />     ********        <br />    ************     <br />    ####....#.       <br />  #..###.....##....  <br />  ###.......######   <br />     ...........     <br />    ##*#######       <br /> ####*******######   <br />...#***.****.*###....<br />....**********##.....<br />....****    *****....<br />  ####        ####   <br />######        ###### <br />####################<br />#------------------#<br />#------------------#<br />####################<br />    #----------#    <br />    #----------#    <br />    #----------#    <br />    #----------#        <br />    ############    <br /></pre>
<p>水管不在 mario 的脚下:</p>
<pre style="font-family: monospace; white-space: pre"><br />     ********        <br />    ************     <br />    ####....#.       <br />  #..###.....##....  <br />  ###.......######   <br />     ...........     <br />    ##*#######       <br /> ####*******######   <br />...#***.****.*###....<br />....**********##.....<br />....****    *****....<br />  ####        ####   <br />######        ###### <br /> ####################<br /> #------------------#<br /> #------------------#<br /> ####################<br />     #----------#    <br />     #----------#    <br />     #----------#    <br />     #----------#        <br />     ############    <br /></pre>
<p>当mario和mushroom重叠，mario会变大。且mushroom消失。</p>
<p>当mario和金币重叠，mario会获得100分。且coin消失。</p>
<p>如果mario脚下没有砖块或者水管，它会不断往下掉。</p>
<p>如果当前mario到达了地图的底部，且还是没有block和tube，mario就输了。必须输出：</p>
<br />
<br />
<pre style="font-family: monospace; white-space: pre"><br />....#####.......#........#...#..#####.........###...#.....#..#####.......#####.....<br />...#...........#.#......##..##..#............#...#..#....#...#..........#.....#...<br />...#..........#..#.....#.#.#.#..#####........#...#..#...#....#####.....#######...<br />...#..###... #####....#..##..#..#............#...#..#..#.....#........#..#......<br />...#....#...#....#...#...#...#..#............#...#..#.#......#.......#....#....<br />....###.#..#.....#..#........#..#####.........###...##.......#####..#......#..<br /></pre>
</div>
</dd>
<dd>
<p></p>
</dd>
</p></div><h2>Output</h2><div class=content><p></p>
<p>
<dd>
<p>对于每个P，输出当前的地图以及一行得分情况 &quot;Mario : ? points&quot;。P与P之间输出一个空行</p>
</dd>
<dd>
<p></p>
</dd>
</p></div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>100 150<br />
9 0<br />
-1 -1<br />
0 42 0 90<br />
4 0 0 0 14 0 28 0 76<br />
5 12 28 12 62 12 76 12 90 12 42<br />
RRRRRRRRRRRP<br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                                                                                                                                                      <br />
                ********                                                                                                                              <br />
               ************                                                                                                                           <br />
               ####....#.                                                                                                                             <br />
             #..###.....##....                                                                                                                        <br />
             ###.......######              ###                 ###           ###           ###                                                        <br />
                ...........               #...#               #...#         #...#         #...#                                                       <br />
               ##*#######                 #.#.#               #.#.#         #.#.#         #.#.#                                                       <br />
            ####*******######             #.#.#               #.#.#         #.#.#         #.#.#                                                       <br />
           ...#***.****.*###....          #...#               #...#         #...#         #...#                                                       <br />
           ....**********##.....           ###                 ###           ###           ###                                                        <br />
           ....****    *****....                                                                                                                      <br />
             ####        ####                                                                                                                         <br />
           ######        ######                                                                                                                       <br />
##############################################################              ##################################                                        <br />
#...#......#.##...#......#.##...#......#.##------------------#              #...#......#.##------------------#                                        <br />
###########################################------------------#              ###############------------------#                                        <br />
#..#....#....##..#....#....##..#....#....#####################              #..#....#....#####################                                        <br />
##########################################    #----------#                  ##############    #----------#                                            <br />
#.....#......##.....#......##.....#......#    #----------#                  #.....#......#    #----------#                                            <br />
##########################################    #----------#                  ##############    #----------#                                            <br />
#.#..#....#..##.#..#....#..##.#..#....#..#    #----------#                  #.#..#....#..#    #----------#                                            <br />
##########################################    ############                  ##############    ############                                            <br />
Mario : 100 points<br />
</span></div><h2>HINT</h2>
			<div class=content><p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search='></a></p></div><center>[<a href='submitpage.php?id=2290'>Submit</a>][<a href='problemstatus.php?id=2290'>Status</a>][<a href='bbs.php?id=2290'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
